package structure;

import java.util.ArrayList;

public class Move {
	
	private ArrayList<Coordinate> stones;
	private byte color;
	
	public Move(String move, byte color){
		String[] coords = move.split("-");
		
		stones = new ArrayList<Coordinate>();
		for(String c : coords)
			stones.add(new Coordinate(c));
		
		this.color = color;
		
	}
	
	public Move(Coordinate c, byte color){
		stones =  new ArrayList<Coordinate>();
		stones.add(new Coordinate(c.x,c.y));
		this.color = color;
	}
	
	public Move(ArrayList<Coordinate> stones, byte color){
		stones =  new ArrayList<Coordinate>();
		for(Coordinate c : stones)
			this.stones.add(new Coordinate(c.x,c.y));
		this.color = color;
	}
	
	public byte getColor(){
		return color;
	}
	
	public ArrayList<Coordinate> getStones(){
		return stones;
	}
	
	
	public String toString(){
		String move = stones.get(0).toString();
		for(int i = 1; i<stones.size();i++)
			move += "-"+stones.get(i);
		
		return move;
	}
}
